﻿using EPiServer.Framework.DataAnnotations;
using System;

namespace OpenWaves.EPiServer.GeoProperties
{
    [TemplateDescriptor(TagString = PropertyGeoRectangle.UiHint)]
    public class PropertyGeoRectangleControl : PropertyGeoObjectControl<GeoRectangle>
    {
        public PropertyGeoRectangleControl()
        {
            
        }

        protected override string CreateMapUrl(GeoRectangle value)
        {
            if (value == null) return String.Empty;

            var googleMapApiInfo = GoogleMapsApiInfo.Default;

            return value.GetImageUrl(googleMapApiInfo.Width, googleMapApiInfo.Height);            
        }
    }
}